package com.tport.client.service.impl;

import java.io.IOException;
import java.io.InputStream;
import java.net.Socket;
import java.util.ArrayList;
import java.util.List;

import com.tport.Param;
import com.tport.client.service.PortClientService;

import org.apache.commons.pool2.impl.GenericObjectPool;
import org.apache.commons.pool2.impl.GenericObjectPoolConfig;

public class PortClientServiceImpl implements PortClientService{

	private List<Socket> clist  = new ArrayList<Socket>(); 
	public static GenericObjectPool<Socket> connectionPool;

    static {
        GenericObjectPoolConfig poolConfig = new GenericObjectPoolConfig();
        poolConfig.setMaxTotal(Param.getMaxClientThreadCount());
        poolConfig.setMinIdle(0);
        poolConfig.setMaxIdle(0);
        poolConfig.setMaxWaitMillis(-1);
        PoolClientFactory clientFactory = new PoolClientFactory();
        connectionPool = new GenericObjectPool<>(clientFactory, poolConfig);
    }

	/**
	 * 客户端建立到服务器连接池
	 * @return
	 */
	public int init() {
		
		return 0;
	}
	
}
